<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="all.css" type="text/css" media="screen" />

    <script src="jquery-1.7.2.min.js"></script>
    <script src="login.js"></script>
    <script src="edit.js"></script>
    <script src="enter.js"></script>
<title>社团主页 - <c:out value="${leagueBean.name}" /></title>
<script type="text/javascript">
function showDiv(){
document.getElementById('popDiv').style.display='block';
document.getElementById('bg').style.display='block';
}
function closeDiv(){
document.getElementById('popDiv').style.display='none';
document.getElementById('bg').style.display='none';
}

function showDiv1(){
document.getElementById('popDiv1').style.display='block';
document.getElementById('bg').style.display='block';
}
function closeDiv1(){
document.getElementById('popDiv1').style.display='none';
document.getElementById('bg').style.display='none';
}
</script>
<script type="text/javascript">

window.onload=function(){
	rightH=document.getElementById("shetuan_right").offsetHeight;
	if(rightH<600){
	document.getElementById("shetuan_left").style.height=600+"px";}
	else{
		document.getElementById("shetuan_left").style.height=rightH+"px";
	}
	select();
}

</script>
<script language="JavaScript"> 
<!-- 
//图片按比例缩放 
var flag=false; 
function DrawImage(ImgD){ 
 var image=new Image(); 
 var iwidth = 322;  //定义允许图片宽度 
 var iheight = 215;  //定义允许图片高度 
 image.src=ImgD.src; 
 if(image.width>0 && image.height>0){ 
 flag=true; 
 if(image.width/image.height>= iwidth/iheight){ 
  if(image.width>iwidth){   
  ImgD.width=iwidth; 
  ImgD.height=(image.height*iwidth)/image.width; 
  }else{ 
  ImgD.width=image.width;   
  ImgD.height=image.height; 
  } 
  ImgD.alt=image.width+"×"+image.height; 
  } 
 else{ 
  if(image.height>iheight){   
  ImgD.height=iheight; 
  ImgD.width=(image.width*iheight)/image.height;   
  }else{ 
  ImgD.width=image.width;   
  ImgD.height=image.height; 
  } 
  ImgD.alt=image.width+"×"+image.height; 
  } 
 } 
}  
//--> 
</script> 
</head>

<body>
<div id="main">
 <div id="header">
       <div id="header_inner">
          <div id="header_inner_top">
          <div id="container">
            <jsp:include page="./head.jsp" flush="true"/> 
            </div>
        </div>
        </div>
	</div>

	<div id="shetuan_body">
    	<div id="shetuan_left">
        	<div id="shetuan_left_left">
        		<div id="left_logo">
               		<a class="left_a" href="http://herald.seu.edu.cn" >
                 	
              		 </a>  
            	</div>
                <div id="left_platform">
               		<a class="left_a" href="http://herald.seu.edu.cn/league_p/" >
                 	
              		 </a>  
            	</div>
                <div id="zy_left_home">
               		<a class="left_a" href="javascript:void(0)" >
                 	
              		 </a>  
            	</div>
                <div id="zy_left_information">
               		<a class="left_a" href="activities.jsp?league=<%=request.getParameter("league") %>" >
                 	
              		 </a>  
            	</div>
                <div id="left_album">
               		<a class="left_a" href="albums.jsp?league=<%=request.getParameter("league") %>" >
                 	
              		 </a>  
            	</div>
                <div id="left_recruiting">
               		<a class="left_a" href="recruit.jsp?league=<%=request.getParameter("league") %>" >
                 	
              		 </a>  
            	</div>
                <div id="left_polling">
               		<a class="left_a" href="polling.jsp?league=<%=request.getParameter("league") %>" >
                 	
              		 </a>  
            	</div>
                <div id="left_guestbook">
               		<a class="left_a" href="guestbook.jsp?league=<%=request.getParameter("league") %>" >
                 	
              		 </a>  
            	</div>
    
             </div>
             <div id="shetuan_left_right">
             </div>
         </div>
         <div id="shetuan_right">
         	<div id="right_title_kuangjia">
         	<div id="right_title">
                <div id="right_title_name">
                   <p><c:out value="${leagueBean.name}" /></p>
                </div>
                <!--未登录  -->
                <c:if test="${leagueUserAuth == null&&commonUserAuth == null}">
                <div id="right_title_attention">
                	<div id="right_title_attention_plus">
                    </div>
                    <div id="right_title_attention_text">
                    <form id="attentionAddForm" action="./AttentionAdd">
                    <input name="league" type="hidden" value=<%=request.getParameter("league") %> />
                    <input name="url" type="hidden" id="url" value="" />
                    </form>
                        <a title="加关注" href="javascript:void(0)" onclick="javascript:alert('您好，请您先登录。')">加关注</a>
                    </div>
                </div>
                </c:if>
              <!--未加关注  -->
                <c:if test="${attention == false && leagueUserAuth == null && commonUserAuth != null}">
                <div id="right_title_attention">
                	
                    <div id="right_title_attention_text">
                    <form id="attentionAddForm" action="./AttentionAdd" onsubmit="return false;">
                    <input name="league" type="hidden" value=<%=request.getParameter("league") %> />
                    <input name="url" type="hidden" id="url" value="" />
                    </form>
                    
                        <a id="att" style="display:block" title="加关注&nbsp;&nbsp;" href="javascript:void(0)" onclick="javascript:attention(<%=request.getParameter("league") %>);"><div id="right_title_attention_plus">
                    </div>加关注</a>
                        <a id="cancleAtt" style="display:none" title="取消关注" href="javascript:void(0)" onclick="javascript:cancleAttention(<%=request.getParameter("league") %>);">取消关注</a>
                    </div>
                </div>
                </c:if>
                
                <!--已加关注-->
                <c:if test="${attention == true}">
                <div id="right_title_attention">
                    <div id="right_title_attention_text">
                    <form id="attentionDeleteForm" action="./AttentionDelete">
                    <input name="league" type="hidden" value=<%=request.getParameter("league") %> />
                    <input name="url" type="hidden" id="url" value="" />
                    </form>
                    <a id="att" style="display:none" title="加关注&nbsp;&nbsp;" href="javascript:void(0)" onclick="javascript:attention(<%=request.getParameter("league") %>);"><div id="right_title_attention_plus">
                    </div>加关注</a>
                    <a id="cancleAtt" style="display:block" title="取消关注" href="javascript:void(0)" onclick="javascript:cancleAttention(<%=request.getParameter("league") %>);">取消关注</a>
                    </div>
                </div>
                </c:if>
                
            </div>
            </div>
            <div id="right_shouye_caozuo">
            	<div id="right_shouye_caozuo_xiugai_kj">
            	<c:if test="${leagueUserAuth != null && param.league != null && leagueUserAuth.leagueId == param.league}">
            	<div id="right_shouye_caozuo_xiugai">
                	<a href="javascript:void(0)"onclick="javascript:showDiv()">修改社团头像</a>
                </div>
                </c:if>
                </div>
                <div id="right_shouye_caozuo_bianji_kj">
            	<c:if test="${leagueUserAuth != null && param.league != null && leagueUserAuth.leagueId == param.league}">
                <div id="right_shouye_caozuo_bianji">
                	<a href="javascript:void(0)" onclick="javascript:showDiv1()">编辑介绍</a>
                </div>
                </c:if>
                </div>
            </div>
            <div id="right_picture_kj">
         	<div id="right_picture">
            	
				<div id="right_picture_pic "style=" width:322px;height:215px;text-align:center;">
					<img  style="border:2px solid #D9D9DA;"src="<c:out value="${leagueBean.portrait}" />" onload = "DrawImage(this)" />
				</div>
            </div>
            </div>
            <div id="right_introduce_kj">
            <div id="right_introduce">
            <p><c:out value="${leagueBean.introduction}" /></p>
            </div>
            </div>
            
            <div id=right_info_photo>
            
            <div id="right_information_kj">
            <div id="right_information">
            	<div class="right_information_title">
                	<div class="right_information_title_infor">
                    	<div class="right_information_title_infor_logo">
                        </div>
                        <div class="right_information_title_infor_text_kj">
                        <div class="right_information_title_infor_text">
                         <p>活动信息</p>
                        </div>
                        </div>
                    </div>
                    <div class="right_information_title_more">
                    	<a href="activities.jsp?league=<%=request.getParameter("league") %>">更多...</a>
                    </div>
                </div>
                <div class="right_information_huodong">

                   <div class="huodongzhengti">
                <c:forEach items="${activities}" var="linkedActivity">
                    <div class="right_information_huodong_huodong1_kj">
                	<div class="right_information_huodong_huodong1">
                    	<div class="right_information_huodong_huodong1_logo">
                        </div>
                        <div class="right_information_huodong_huodong1_text_kj">
                        <div class="right_information_huodong_huodong1_text">
                        	<a href="activity.jsp?activity=<c:out value="${linkedActivity.link}" />&league=<%=request.getParameter("league") %>"><c:out value="${linkedActivity.entity.name}" /></a>
                        </div>
                        </div>
                    </div>
                    </div>
                    <div class="right_information_huodong_line1">
                    </div>
                    </c:forEach>
                   </div>
                </div>
                
            </div>
            </div>
            
            
           <div id="right_photo_kj">
           <div id="shetuan_right_photo">
                	<div class="right_information_title">
                	<div class="right_information_title_infor">
                    	<div class="right_information_title_infor_logo">
                        </div>
                        <div class="right_information_title_infor_text_kj">
                        <div class="right_information_title_infor_text">
                         <p>相册</p>
                        </div>
                        </div>
                    </div>
                    <div class="right_information_title_more">
                    	<a href="albums.jsp?league=<%=request.getParameter("league") %>">更多...</a>
                    </div>
                </div>
                
                <div class="right_information_huodong">
                   <div class="huodongzhengti">
                   <c:forEach items="${albums}" var="album">
                    <div class="right_information_huodong_huodong1_kj">
                	<div class="right_information_huodong_huodong1">
                    	<div class="right_information_huodong_huodong1_logo">
                        </div>
                        <div class="right_information_huodong_huodong1_text_kj">
                        <div class="right_information_huodong_huodong1_text">
                        	<a href="album.jsp?league=<%=request.getParameter("league") %>&album=<c:out value="${album.key}" />"><c:out value="${album.value.name}" /></a>
                        </div>
                        </div>
                    </div>
                    </div>
                    <div class="right_information_huodong_line1">
                    </div>
                    </c:forEach>
                   </div>
                </div>
                   
                   
            </div>
            </div>
            </div>
            
            <div id="right_liuyanban">
            	<div id="right_liuyanban_title_kj">
            	<div id="right_liuyanban_title">
                    	<div id="right_liuyanban_title_logo">
                        </div>
                        <div id="right_liuyanban_title_text_kj">
                        <div id="right_liuyanban_title_text">
                        	<p>留言板</p>
                        </div>
                        </div>
                 </div>
                 </div>
                 <c:forEach items="${messages}" var="message" varStatus="varStatus">
	             <c:if test="${varStatus.index <= 7}">
                 <div class="right_liuyanban_line_kj">
                 <div class="right_liuyanban_line">
                 </div>
                 </div>
                 <div class="right_liuyanban_liuyan1">
                 	<div class="right_liuyanban_liuyan1_text_kj">
                    <div class="right_liuyanban_liuyan1_text">
                 		<a href="guestbook.jsp?league=<%=request.getParameter("league") %>">
                	 	<c:choose>
				             <c:when test="${varStatus.index == 7}">
				             	<c:out value="更多..." />
				             </c:when>
				             <c:otherwise>
	             			<c:out value="${message.entity.content}" />
				             </c:otherwise>
	             		</c:choose>
                 		</a>
                    </div>
                    </div>
                 </div>
	             </c:if>
                 </c:forEach>
                 <div class="right_liuyanban_line_kj">
                 <div class="right_liuyanban_line">
                 </div>
                 </div>
            </div>
            
            	
            </div>
         <div class="clear">
		 </div>
     </div>     
     
     
     
     
     
     
     
     
     
<div id="popDiv"  class="mydiv" style="display:none;">
修改头像
<form  id="editMainPicForm" action="./PortraitUpload" method="post" enctype="multipart/form-data" >
    <div id="uploadForm">
    <p>   
         <input type="file" name="fileforload" />
    </p>
    </div>
   
    <p style="padding-left:100px;text-align:left;"><input type="submit" value="提交"  name="submit"  /><a style="padding-left:60px;" href="javascript:closeDiv()">关闭</a></p>
  </form>
</div>
<div id="bg" class="bg" style="display:none;"></div>
      
     
     
<div id="popDiv1" class="mydiv" style="display:none;">
编辑社团简介
<form  id="introduceEditForm" action="./LeagueIntroduceEdit" method="post" >
    
  <textarea rows="6" cols="30" name="introduce">  </textarea>
   
  <p style="padding-left:100px;text-align:left;"><input type="submit" value="提交"  name="submit"  />
  <a style="padding-left:60px;"href="javascript:closeDiv1()">关闭</a></p>
  </form>
</div>
<div id="bg" class="bg" style="display:none;"></div>  
     
<jsp:include page="./footer.jsp" flush="true"/> 
</div>

</body>
</html>
